package com.heima.pojo.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.time.LocalDate;
import java.time.LocalDateTime;

@Data
@TableName("tb_sku")
@ApiModel(description = "商品实体类")
public class Sku {
    @TableId(value = "sku_id",type = IdType.ASSIGN_ID)
    @JsonSerialize(using = ToStringSerializer.class)//把当前字段转换为字符串进行响应
    private Long skuId;

    @TableField(value = "sku_name")
    private String skuName;

    @TableField(value = "sku_image")
    private String skuImage;

    @TableField(value = "price")
    private Integer price;

    @TableField(value = "class_id")
    private Integer classId;

    @TableField(value = "is_discount")
    private Boolean isDiscount;

    @TableField(value = "unit")
    private String unit;

    @TableField(value = "brand_Name")
    private String brandName;

    @TableField(value = "create_time",fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss")
    private LocalDateTime createTime;

    @TableField(value = "update_time",fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss")
    private LocalDateTime updateTime;

}
